#include "UdpServer.hpp"
#include <memory>
#include "MessageRoute.hpp"
#include "ThreadPool.hpp"
void Usage(string proc)
{
    cout<<"Usage: "<<proc<<"port\n"<<endl;
}

int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(-1);
    }
    EnableScreen();

    MessageRoute route;
    uint16_t port = stoi(argv[1]);
    unique_ptr<UdpServer> ptr = make_unique<UdpServer>(port,std::bind(&MessageRoute::Route,&route,std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));//c++14特性
    ptr->InitServer();
    ptr->Start();
    //启动服务端
    return 0;
}
